'''
Created on 2012-4-9下午9:25:00

@author: yasenagat
@email:   yasenagat@gmail.com

'''
import socket,sys
#print(sys.argv)
#print(sys.argv[1])

HOST = 'localhost'    # The remote host
PORT = 12345              # The same port as used by the server

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

s.connect((HOST, PORT))

s.sendall(bytes(sys.argv[1],"utf-8"))

data = s.recv(1024)

s.close()

print('from server to client：', str(data,"utf-8"))